import Router from "koa-router";
import FormCtrl from "./controller/onlineFormDesign.ctrl";
import orgCtrl from "./controller/org.ctrl";
import PriceCtrl from "./controller/price.ctrl";
export const router: any = new Router({ prefix: "/api-saas-psc/app" });

// form
router.post("/onlineFormDesign/page", FormCtrl.getFormList);
router.get("/onlineFormDesign/list", FormCtrl.detail);
router.post("/onlineFormDesign/updateUseFlag", FormCtrl.updateUseFlag);
router.post("/onlineFormDesign/add", FormCtrl.createForm);
router.post("/onlineFormDesign/update", FormCtrl.updateForm);
router.post("/onlineFormDesign/orgs", FormCtrl.getSelectedOrgs);
router.post("/onlineFormDesign/users", FormCtrl.getSelectedUsers);
router.post("/onlineFormDesign/orgs/update", FormCtrl.updateForm);
router.post("/onlineFormDesign/users/update", FormCtrl.updateForm);
router.post("/onlineFormDesign/auditors", FormCtrl.getAuditList);
router.post("/onlineFormDesign/auditors/save", FormCtrl.updateForm);

router.post("/outer/orgs", orgCtrl.getOutOrgs);
router.post("/outer/update", orgCtrl.updateOutOrg);

router.post("/outer/opsQuoteCost/save", PriceCtrl.save);
router.post("/outer/opsQuoteCost/page", PriceCtrl.page);
router.post(
  "/outer/opsQuotStandardProcess/getProcess",
  PriceCtrl.getAllProcess
);
router.post("/outer/opsQuoteProcessTemplate/getNode", PriceCtrl.getNodes);

export default function (app: any) {
  app.use(router.routes());
}
